import { getToken } from '@/utils/auth'

const state = {
  token: getToken(),
  id: null,
  name: '',
  mods: [],
  permissions: []
}

const mutations = {
  SET_TOKEN: (state, token) => {
    state.token = token
  },
  SET_ID: (state, id) => {
    state.id = id
  },
  SET_NAME: (state, name) => {
    state.name = name
  },
  SET_MODS: (state, mods) => {
    state.mods = mods
  },
  SET_PERMISSIONS: (state, permissions) => {
    state.permissions = permissions
  }
}

const actions = {
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
